﻿<Window x:Class="StackHash.ServiceCredentials"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="StackHash Service Credentials - StackHash" ResizeMode="CanMinimize" SizeToContent="Height" Width="400" Icon="/StackHash;component/StackHash.ico" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded" Closed="Window_Closed">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="MasterResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="Help" x:Name="commandBindingHelp" Executed="commandBindingHelp_Executed" />
    </Window.CommandBindings>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Margin="10" TextWrapping="Wrap" Grid.ColumnSpan="2">Enter the username, password and optionally the domain of the account to use to access the StackHash service. To use your current Windows credentials leave all three fields empty.</TextBlock>

        <Label Margin="7" Grid.Row="1" Target="{Binding ElementName=textBoxUsername}">_Username:</Label>
        <TextBox Margin="0,10,10,10" Grid.Row="1" Grid.Column="1" Name="textBoxUsername"></TextBox>

        <Label Margin="7,0,7,7" Grid.Row="2" Target="{Binding ElementName=passwordBoxPassword}">_Password:</Label>
        <TextBox Margin="0,3,10,10" Grid.Row="2" Grid.Column="1" Visibility="Hidden"></TextBox>
        <PasswordBox Margin="0,3,10,10" Grid.Row="2" Grid.Column="1" Name="passwordBoxPassword"></PasswordBox>

        <Label Margin="7,0,7,7" Grid.Row="3" Target="{Binding ElementName=textBoxDomain}">_Domain:</Label>
        <TextBox Margin="0,3,10,20" Grid.Row="3" Grid.Column="1" Name="textBoxDomain"></TextBox>

        <Border Grid.Row="4" Grid.ColumnSpan="2" Style="{StaticResource ButtonBorder}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Button Margin="10" Command="Help">Help</Button>

                <StackPanel Grid.Column="1" Margin="7" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Margin="3" IsDefault="True" Name="buttonOK" Click="buttonOK_Click">OK</Button>
                    <Button Margin="3" IsCancel="True">Cancel</Button>
                </StackPanel>

            </Grid>
        </Border>

    </Grid>
</Window>
